package com.readytheory.thisisstupid;

import javax.ws.rs.Path;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Produces;
import javax.ws.rs.FormParam;

@Path("/saying")
   public class SayingController {
	
    
@POST
    @Path("/add")
    public void addASaying( @FormParam("authorName") String authorName,
			    @FormParam("saying") String sayingToAdd )
	{
	    SayingIO sio = new SayingIO();
	    sio.Add(sayingToAdd, authorName);
	}


       
       @GET
	   @Path("/get")
	   public String getASaying()
       {
	   SayingIO sio =  new SayingIO();
	   String response = sio.getAll();
	   return response;
       }
   }
       